package fr.vahren.dotastrat.model;

import java.util.ArrayList;
import java.util.List;

import org.json.simple.JSONObject;

import fr.vahren.dotastrat.game.effect.D2SEffect;
import fr.vahren.dotastrat.game.D2SGameState;

public abstract class D2SUnit {

	protected String name;
	protected int id;
	protected D2SSide side;
	protected boolean moving;

	/**
	 * List of hero units that attacked the hero this turn
	 */
	protected List<Integer> attackers = new ArrayList<>();

	public abstract void applyAttackDamage(D2SUnit target, boolean reduced,
			D2SUnit unit);

	public abstract int getArmor();

	public abstract void removeHealth(int dmg);

	public String getName() {
		return name;
	}

	public int getId() {
		return id;
	}

	public D2SSide getSide() {
		return side;
	}

	public abstract int getCurrentHealth();

	public abstract int getMaxHealth();

	public abstract int getCurrentMana();

	public abstract int getMaxMana();

	public abstract JSONObject generateInfo(D2SGameState phase);

	public boolean isMoving() {
		return moving;
	}

	public  void addAttacker(int id){
		attackers.add(id);
	}
	
	public List<Integer> getAttackers(){
		return attackers;
	}

	public boolean isDead() {
		return getCurrentHealth() <= 0;
	}

	public abstract int getSpeed();

	public abstract List<D2SEffect> getEffects();
	public abstract int getAttackRange();

	public abstract int getGoldBounty(int nbAttackers) ;

	public abstract int getExpBounty(int nbAttackers) ;
}
